﻿using System;
using System.Collections.Generic;
using OpenGL;

namespace System
{
	public partial struct V3D
	{
		public void GLDraw()
		{
			GL.glVertex3d(X, Y, Z);
		}
		public void GLNorm()
		{
			GL.glNormal3d(X, Y, Z);
		}
		public void GLCol()
		{
			GL.glColor3d(X, Y, Z);
		}
		public void GLCol(double alpha)
		{
			GL.glColor4d(X, Y, Z, alpha);
		}
		public void GLTex()
		{
			GL.glTexCoord2d(X, Y);
		}
		public void GLTrans()
		{
			GL.glTranslated(X, Y, Z);
		}
		public void GLRot(double angle)
		{
			GL.glRotated(angle, X, Y, Z);
		}
		public void GLSign(double size)
		{
			GL.glBegin(GL.GL_LINES);
			V3D.Red.GLCol();
			(this + (size * V3D.Red)).GLDraw();
			(this - (size * V3D.Red)).GLDraw();
			V3D.Green.GLCol();
			(this + (size * V3D.Green)).GLDraw();
			(this - (size * V3D.Green)).GLDraw();
			V3D.Blue.GLCol();
			(this + (size * V3D.Blue)).GLDraw();
			(this - (size * V3D.Blue)).GLDraw();
			GL.glEnd();
		}
		public void GLSign(double size, V3D Color)
		{
			GL.glBegin(GL.GL_LINES);
			Color.GLCol();
			(this + (size * V3D.Red)).GLDraw();
			(this - (size * V3D.Red)).GLDraw();
			(this + (size * V3D.Green)).GLDraw();
			(this - (size * V3D.Green)).GLDraw();
			(this + (size * V3D.Blue)).GLDraw();
			(this - (size * V3D.Blue)).GLDraw();
			GL.glEnd();
		}
	}
}